﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MOMKeLABS.Controls.Login
{
    public class StatusListBox : ListBox 
    {
        public void AddUpdate(string message, Constants.AuthenticationConstants.LoginStatus.StatusTypes type)
        {

            this.Items.Add(new ListBoxItem()
            {
                Content = DateTime.Now.ToString(Constants.AuthenticationConstants.LoginStatus.STATUS_DATE_FORMAT) + ": " + message,
                Foreground = new SolidColorBrush((Color)App.Current.Resources[typeof(Constants.AuthenticationConstants.LoginStatus.StatusTypes).Name + Enum.GetName(typeof(Constants.AuthenticationConstants.LoginStatus.StatusTypes), type)])
            });
        }

        public void ShowLoginURL()
        {
            this.Items.Add(new ListBoxItem()
            {
                Content = new HyperlinkButton()
                {
                    NavigateUri = new Uri("http://lab.monkelabs.com/php/OpenID/google_auth.php"),
                    Content = "Click here to login"
                }
            });
        }
    }
}
